import React, { Component } from 'react'
import { NavBar, Icon } from 'antd-mobile';
// import "../../../public/icons"
import "./nav.scss"
import { withRouter } from "react-router-dom"
class nav extends Component {
    handleSearch = () => {
        console.log("jfklad");
    }
    render() {
        return (
            <div>
                <NavBar
                    mode="light"
                    leftContent={<i className="icon icon-home"></i>}
                    onLeftClick={() => this.props.history.push("/home")}
                    rightContent={[
                        <Icon key="0" onClick={this.handleSearch} type="search" style={{ marginRight: '16px', color: "#939691" }} />,
                        <div key="1" className="navicon">
                            <i className="icon icon-cart" onClick={() => this.props.history.push("/car")}> <span className="carnum"> 5</span></i></div>
                    ]}
                >{this.props.title}</NavBar>
            </div>
        )
    }
}
export default withRouter(nav)
